﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Windows.Forms.Integration;
using System.Windows.Forms;

namespace HabitAnalyzer
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class BasicReport : Window
    {
        ObservableCollection<SessionActivity> _ActInfo = new ObservableCollection<SessionActivity>();

        public BasicReport(List<SessionActivity> l, string title)
        {

            InitializeComponent();
            this.Title = title;
            int i, c = l.Count;
            if (c == 0)
            {
                label1.Visibility = Visibility.Visible;
                table.Visibility = Visibility.Hidden;
            }
            for (i = 0; i < c; i++)
            {
                DbUtility db = new DbUtility();
                Console.WriteLine("for loop", i);
                _ActInfo.Add(l.ElementAt<SessionActivity>(i));
            }

            Console.WriteLine("here");
            Console.WriteLine(l.ToString());
            Console.WriteLine("done");
        }

        public ObservableCollection<SessionActivity> ActInfo
        { get { return _ActInfo; } }

        private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {

        }

        private void ReportWindow_Loaded(object sender, RoutedEventArgs e)
        {
            /* 
     // Create the interop host control.
     System.Windows.Forms.Integration.WindowsFormsHost host =
         new System.Windows.Forms.Integration.WindowsFormsHost();

     // Create the MaskedTextBox control.
     MaskedTextBox mtbDate = new MaskedTextBox("00/00/0000");

     // Assign the MaskedTextBox control as the host control's child.
     host.Child = mtbDate;

     // Add the interop host control to the Grid
     // control's collection of child controls.
     this.grid1.Children.Add(host);
             */

            /*
             * HabitAnalyzer.habitanalyzerDataSet habitanalyzerDataSet = ((HabitAnalyzer.habitanalyzerDataSet)(this.FindResource("habitanalyzerDataSet")));
            // Load data into the table Acitivity. You can modify this code as needed.
            HabitAnalyzer.habitanalyzerDataSetTableAdapters.AcitivityTableAdapter habitanalyzerDataSetAcitivityTableAdapter = new HabitAnalyzer.habitanalyzerDataSetTableAdapters.AcitivityTableAdapter();
            habitanalyzerDataSetAcitivityTableAdapter.Fill(habitanalyzerDataSet.Acitivity);
            System.Windows.Data.CollectionViewSource acitivityViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("acitivityViewSource")));
            acitivityViewSource.View.MoveCurrentToFirst();
            // Load data into the table SessionActivity. You can modify this code as needed.
            HabitAnalyzer.habitanalyzerDataSetTableAdapters.SessionActivityTableAdapter habitanalyzerDataSetSessionActivityTableAdapter = new HabitAnalyzer.habitanalyzerDataSetTableAdapters.SessionActivityTableAdapter();
            habitanalyzerDataSetSessionActivityTableAdapter.Fill(habitanalyzerDataSet.SessionActivity);
            System.Windows.Data.CollectionViewSource sessionActivityViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("sessionActivityViewSource")));
            sessionActivityViewSource.View.MoveCurrentToFirst();
             */
        }
    }
}
